﻿import { layout } from '@/app';

const pathgen = (pathnow: string) => {
  return process.env.NODE_ENV === 'production'
    ? 'https://juyou.js-beyond.com:39443/workManage/#/ant-design-pro' + pathnow
    : pathnow;
  // return 'https://juyou.js-beyond.com:39443/workManage/#/ant-design-pro' + pathnow;
};
export default [
  {
    path: '/403',
    component: './403',
    key: 'noauth',
    layout: false,
  },
  {
    path: '/',
    redirect: '/home',
    layout: false,
  },
  {
    path: '/home',
    component: './home',
  },
  {
    path: '/report',
    component: './report',
  },
  {
    path: '/apply',
    component: './apply',
  },
  {
    path: '/query',
    component: './query',
  },
  {
    path: '/user',
    layout: false,
    key: 'user',
    routes: [
      {
        name: 'login',
        path: '/user/login',
        component: './user/Login',
        key: 'userLogin',
      },
      {
        name: 'login',
        path: '/user/register',
        component: './user/register',
        key: 'userregister',
      },
      {
        component: './404',
      },
    ],
  },
  {
    path: '/admin',
    name: '系统管理',
    key: 'baseadmin',
    flatMenu: true,
    component: './../layouts/BaseLayout',
    routes: [
      {
        path: '/admin/sysMan',
        name: '系统管理',
        key: 'sysMan',

        hideMenu: true,
        routes: [
          {
            path: '/admin/sysMan/appApi',
            name: 'API管理',

            component: './sysman/appApi',
            // component: './addedServices/gasAppliances',
            key: 'appApi',
            access: 'normalRouteFilter',
          },
          {
            path: '/admin/sysMan/userManager',
            name: '用户管理',

            component: './sysman/userManager',
            // component: './addedServices/gasAppliances',
            key: 'userManager',
            access: 'normalRouteFilter',
          },
          {
            path: '/admin/sysMan/menusManager',
            name: '菜单管理',

            component: './sysman/menusManager',
            // component: './addedServices/gasAppliances',
            key: 'menusManager',
            access: 'normalRouteFilter',
          },
          {
            path: '/admin/sysMan/userRolesManager',
            name: '角色管理',

            component: './sysman/userRolesManager',
            // component: './addedServices/gasAppliances',
            key: 'userRolesManager',
            access: 'normalRouteFilter',
          },
          {
            path: '/admin/sysMan/authsManager',
            name: '权限管理',

            component: './sysman/authsManager',
            // component: './addedServices/gasAppliances',
            key: 'authsManager',
            access: 'normalRouteFilter',
          },
          {
            path: '/admin/sysMan/index',
            name: '指标块管理',

            component: './sysman/index',
            // component: './addedServices/gasAppliances',
            key: 'index',
            access: 'normalRouteFilter',
          },
          {
            path: '/admin/sysMan/indexgroup',
            name: '指标组管理',

            component: './sysman/indexgroup',
            // component: './addedServices/gasAppliances',
            key: 'indexgroup',
            access: 'normalRouteFilter',
          },
          {
            path: '/admin/sysMan/indexpage',
            name: '指标页管理',

            component: './sysman/indexpage',
            // component: './addedServices/gasAppliances',
            key: 'indexpage',
            access: 'normalRouteFilter',
          },
        ],
      },
    ],
  },
];

// let arr = [];
// let newarr = [];
// arr[0].children.map((e) => {
//   newarr.push({
//     path: '/admin/business/' + e.href,
//     name: e.name,
//
//     //access: 'normalRouteFilter',
//     component: './gptChats',
//     key: e.href,
//   });
// });
